Optimal. Leaf size=112 \[ \frac{2 b^4 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{a^4 \sqrt{a^2-b^2}}-\frac{\left (2 a^2+3 b^2\right ) \cot (x)}{3 a^3}+\frac{b \left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^4}+\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.433336, antiderivative size = 112, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.538, Rules used = {2802, 3055, 3001, 3770, 2660, 618, 204} \[ \frac{2 b^4 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{a^4 \sqrt{a^2-b^2}}-\frac{\left (2 a^2+3 b^2\right ) \cot (x)}{3 a^3}+\frac{b \left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^4}+\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2802
Rule 3055
Rule 3001
Rule 3770
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\csc ^4(x)}{a+b \sin (x)} \, dx &=-\frac{\cot (x) \csc ^2(x)}{3 a}+\frac{\int \frac{\csc ^3(x) \left (-3 b+2 a \sin (x)+2 b \sin ^2(x)\right )}{a+b \sin (x)} \, dx}{3 a}\\ &=\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a}+\frac{\int \frac{\csc ^2(x) \left (2 \left (2 a^2+3 b^2\right )+a b \sin (x)-3 b^2 \sin ^2(x)\right )}{a+b \sin (x)} \, dx}{6 a^2}\\ &=-\frac{\left (2 a^2+3 b^2\right ) \cot (x)}{3 a^3}+\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a}+\frac{\int \frac{\csc (x) \left (-3 b \left (a^2+2 b^2\right )-3 a b^2 \sin (x)\right )}{a+b \sin (x)} \, dx}{6 a^3}\\ &=-\frac{\left (2 a^2+3 b^2\right ) \cot (x)}{3 a^3}+\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a}+\frac{b^4 \int \frac{1}{a+b \sin (x)} \, dx}{a^4}-\frac{\left (b \left (a^2+2 b^2\right )\right ) \int \csc (x) \, dx}{2 a^4}\\ &=\frac{b \left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^4}-\frac{\left (2 a^2+3 b^2\right ) \cot (x)}{3 a^3}+\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a}+\frac{\left (2 b^4\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{a^4}\\ &=\frac{b \left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^4}-\frac{\left (2 a^2+3 b^2\right ) \cot (x)}{3 a^3}+\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a}-\frac{\left (4 b^4\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{x}{2}\right )\right )}{a^4}\\ &=\frac{2 b^4 \tan ^{-1}\left (\frac{b+a \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{a^4 \sqrt{a^2-b^2}}+\frac{b \left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (x))}{2 a^4}-\frac{\left (2 a^2+3 b^2\right ) \cot (x)}{3 a^3}+\frac{b \cot (x) \csc (x)}{2 a^2}-\frac{\cot (x) \csc ^2(x)}{3 a}\\ \end{align*}
Mathematica [A] time = 1.54879, size = 125, normalized size = 1.12 \[ \frac{\frac{24 b^4 \tan ^{-1}\left (\frac{a \tan \left (\frac{x}{2}\right )+b}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}+a \left (2 a^2+3 b^2\right ) \cos (3 x) \csc ^3(x)-3 a \cot (x) \csc (x) \left (\left (2 a^2+b^2\right ) \csc (x)-2 a b\right )+6 b \left (a^2+2 b^2\right ) \left (\log \left (\cos \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )\right )\right )}{12 a^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.051, size = 162, normalized size = 1.5 \begin{align*}{\frac{1}{24\,a} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{3}}-{\frac{b}{8\,{a}^{2}} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}}+{\frac{3}{8\,a}\tan \left ({\frac{x}{2}} \right ) }+{\frac{{b}^{2}}{2\,{a}^{3}}\tan \left ({\frac{x}{2}} \right ) }+2\,{\frac{{b}^{4}}{{a}^{4}\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( x/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) }-{\frac{1}{24\,a} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-3}}-{\frac{3}{8\,a} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{{b}^{2}}{2\,{a}^{3}} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}}+{\frac{b}{8\,{a}^{2}} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-2}}-{\frac{b}{2\,{a}^{2}}\ln \left ( \tan \left ({\frac{x}{2}} \right ) \right ) }-{\frac{{b}^{3}}{{a}^{4}}\ln \left ( \tan \left ({\frac{x}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 3.05268, size = 1361, normalized size = 12.15 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc ^{4}{\left (x \right )}}{a + b \sin{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.50635, size = 262, normalized size = 2.34 \begin{align*} \frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, x\right ) + b}{\sqrt{a^{2} - b^{2}}}\right )\right )} b^{4}}{\sqrt{a^{2} - b^{2}} a^{4}} + \frac{a^{2} \tan \left (\frac{1}{2} \, x\right )^{3} - 3 \, a b \tan \left (\frac{1}{2} \, x\right )^{2} + 9 \, a^{2} \tan \left (\frac{1}{2} \, x\right ) + 12 \, b^{2} \tan \left (\frac{1}{2} \, x\right )}{24 \, a^{3}} - \frac{{\left (a^{2} b + 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right )}{2 \, a^{4}} + \frac{22 \, a^{2} b \tan \left (\frac{1}{2} \, x\right )^{3} + 44 \, b^{3} \tan \left (\frac{1}{2} \, x\right )^{3} - 9 \, a^{3} \tan \left (\frac{1}{2} \, x\right )^{2} - 12 \, a b^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + 3 \, a^{2} b \tan \left (\frac{1}{2} \, x\right ) - a^{3}}{24 \, a^{4} \tan \left (\frac{1}{2} \, x\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]